.class Lcom/peptalk/client/lbs/android/PhoneLocation;
.super Ljava/lang/Object;
.source "PhoneLocation.java"


# instance fields
.field public accuracy:F

.field public lat:D

.field public lon:D

.field public time:J


# direct methods
.method constructor <init>()V
    .locals 2

    .prologue
    const-wide v0, 0x7fefffffffffffffL

    .line 13
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 14
    iput-wide v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lat:D

    .line 15
    iput-wide v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lon:D

    .line 16
    const v0, 0x7f7fffff

    iput v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->accuracy:F

    .line 17
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->time:J

    .line 13
    return-void
.end method


# virtual methods
.method public json(J)Lorg/json/JSONObject;
    .locals 7
    .parameter "currentTime"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    .prologue
    const-wide v5, 0x412e848000000000L

    .line 65
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    .line 66
    .local v0, location:Lorg/json/JSONObject;
    iget-wide v2, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lat:D

    invoke-static {v2, v3}, Ljava/lang/Math;->abs(D)D

    move-result-wide v2

    cmpg-double v2, v2, v5

    if-gez v2, :cond_1

    iget-wide v2, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lon:D

    invoke-static {v2, v3}, Ljava/lang/Math;->abs(D)D

    move-result-wide v2

    cmpg-double v2, v2, v5

    if-gez v2, :cond_1

    .line 67
    const-string v2, "lon"

    iget-wide v3, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lon:D

    mul-double/2addr v3, v5

    double-to-int v3, v3

    invoke-virtual {v0, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 68
    const-string v2, "lat"

    iget-wide v3, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lat:D

    mul-double/2addr v3, v5

    double-to-int v3, v3

    invoke-virtual {v0, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 69
    const-string v2, "acc"

    iget v3, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->accuracy:F

    float-to-int v3, v3

    invoke-virtual {v0, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 70
    iget-wide v2, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->time:J

    sub-long v2, p1, v2

    const-wide/16 v4, 0x3e8

    div-long/2addr v2, v4

    long-to-int v1, v2

    .line 71
    .local v1, temp:I
    if-gez v1, :cond_0

    const/4 v2, 0x0

    move v1, v2

    .line 72
    :cond_0
    const-string v2, "time"

    invoke-virtual {v0, v2, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-object v2, v0

    .line 75
    .end local v1           #temp:I
    :goto_0
    return-object v2

    :cond_1
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public reset()V
    .locals 2

    .prologue
    const-wide v0, 0x7fefffffffffffffL

    .line 57
    iput-wide v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lat:D

    .line 58
    iput-wide v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lon:D

    .line 59
    const v0, 0x7f7fffff

    iput v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->accuracy:F

    .line 60
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->time:J

    .line 61
    return-void
.end method

.method public toString(J)Ljava/lang/String;
    .locals 5
    .parameter "currentTime"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 82
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "lat="

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lat:D

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "; "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 83
    const-string v1, "lon="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lon:D

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "; "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 84
    const-string v1, "accuracy ="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->accuracy:F

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "; "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 85
    const-string v1, "deltaTime="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->time:J

    sub-long v1, p1, v1

    const-wide/16 v3, 0x3e8

    div-long/2addr v1, v3

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "s\n"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 82
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public write(Ljava/io/ByteArrayOutputStream;J)V
    .locals 5
    .parameter "baos"
    .parameter "currentTime"

    .prologue
    const-wide v3, 0x412e848000000000L

    .line 27
    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lat:D

    invoke-static {v1, v2}, Ljava/lang/Math;->abs(D)D

    move-result-wide v1

    cmpg-double v1, v1, v3

    if-gez v1, :cond_1

    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lon:D

    invoke-static {v1, v2}, Ljava/lang/Math;->abs(D)D

    move-result-wide v1

    cmpg-double v1, v1, v3

    if-gez v1, :cond_1

    .line 29
    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lon:D

    mul-double/2addr v1, v3

    double-to-int v0, v1

    .line 30
    .local v0, temp:I
    shr-int/lit8 v1, v0, 0x18

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 31
    shr-int/lit8 v1, v0, 0x10

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 32
    shr-int/lit8 v1, v0, 0x8

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 33
    and-int/lit16 v1, v0, 0xff

    int-to-byte v1, v1

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 35
    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->lat:D

    mul-double/2addr v1, v3

    double-to-int v0, v1

    .line 36
    shr-int/lit8 v1, v0, 0x18

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 37
    shr-int/lit8 v1, v0, 0x10

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 38
    shr-int/lit8 v1, v0, 0x8

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 39
    and-int/lit16 v1, v0, 0xff

    int-to-byte v1, v1

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 41
    iget v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->accuracy:F

    float-to-int v0, v1

    .line 42
    shr-int/lit8 v1, v0, 0x18

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 43
    shr-int/lit8 v1, v0, 0x10

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 44
    shr-int/lit8 v1, v0, 0x8

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 45
    and-int/lit16 v1, v0, 0xff

    int-to-byte v1, v1

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 47
    iget-wide v1, p0, Lcom/peptalk/client/lbs/android/PhoneLocation;->time:J

    sub-long v1, p2, v1

    const-wide/16 v3, 0x3e8

    div-long/2addr v1, v3

    long-to-int v0, v1

    .line 48
    if-gez v0, :cond_0

    const/4 v1, 0x0

    move v0, v1

    .line 49
    :cond_0
    shr-int/lit8 v1, v0, 0x18

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 50
    shr-int/lit8 v1, v0, 0x10

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 51
    shr-int/lit8 v1, v0, 0x8

    int-to-byte v1, v1

    and-int/lit16 v1, v1, 0xff

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 52
    and-int/lit16 v1, v0, 0xff

    int-to-byte v1, v1

    invoke-virtual {p1, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 54
    .end local v0           #temp:I
    :cond_1
    return-void
.end method
